﻿Ext.define('I2R.view.groupproposal', {
    extend: 'Ext.Panel',
    alias: 'widget.i2rgroupproposal',
    border: false,
    bodyCls: 'padd-up',
    autoScroll: true,
    tbar: [
                {
                 xtype: 'button',
                 iconCls: 'icon_disk',
                 text: 'Save draft'
             },
            {
                xtype: 'button',
                iconCls: 'icon_email-go',
                text: 'Save and submit for review'
            }
    ],
    items: [
        {
            xtype: 'form',
            border: false,
            bodyCls: 'padd-up',
            fieldDefaults: {
                labelAlign: 'left',
                labelWidth: 200,
                labelSeparator: ''
            },
            items: [
                {
                    xtype: 'panel',
                    title: 'Anonymous or named',
                    bodyCls: 'padd-up',
                    cls: 'margin10-below',
                    layout: 'anchor',
                    items: [
                        {
                            fieldLabel: 'Members of the group<br /><span class="small">Choose between an anonymous or a named deviation</span>',
                            xtype: 'fieldcontainer',
                            layout: 'hbox',
                            items: [
                                { xtype: 'button', text: 'Select members...', action: 'selectmembers' },
                                { xtype: 'splitter' },
                                { xtype: 'textfield', name: 'MyNames', emptyText: 'Group members...', readOnly: true, flex: 1 }
                            ]
                        },
                        { fieldLabel: '&nbsp;', boxLabel: 'Anonymous', xtype: 'checkbox', name: 'Anonymous', allowBlank: false }
                        ]
                },
                {
                    xtype: 'panel',
                    title: 'The deviation',
                    bodyCls: 'padd-up',
                    cls: 'margin10-below',
                    layout: 'anchor',
                    items: [
                        { fieldLabel: 'Subject<br /><span class="small">The name of your deviation</span>', xtype: 'textfield', name: 'Subject', allowBlank: false, anchor: '-100' },
                        { fieldLabel: 'Observation/Problem to solve<br /><span class="small">Your observation or problem this deviation is about.</span>', xtype: 'textarea', name: 'ProblemToSolve', allowBlank: false, anchor: '-100', height: 300 },
                        { fieldLabel: 'My proposal/solution<br /><span class="small">Describe your potential proposal/solution</span>', xtype: 'textarea', name: 'MySolution', allowBlank: false, anchor: '-100', height: 300 }
                        ]
                },
                {
                    xtype: 'panel',
                    title: 'Attachments',
                    bodyCls: 'padd-up',
                    cls: 'margin10-below',
                    items: [
                        { fieldLabel: 'File<br /><span class="small">Attach files, like calculations or other necessary documents.</span>', xtype: 'filefield', name: 'Files' }
                        , { xtype: 'button', text: 'Upload' }    
                    ]
                },
                {
                    xtype: 'panel',
                    bodyCls: 'padd-up',
                    cls: 'margin10-below',
                    border: false
                }
            ]
        }
    ]
});